using System.ServiceModel.Syndication;

namespace ServiceModel.Syndication.LEAP2A {
    /// <summary>
    /// Repsents a error found in a LEAP2A feed
    /// </summary>
    public sealed class LeapFeedError {
        /// <summary>
        /// A human readable description of the error
        /// </summary>
        public readonly string Reason;

        /// <summary>
        /// If the error is associated with an Atom entry it will be available through this field
        /// otherwise it will be null.
        /// </summary>
        public readonly SyndicationItem Item;

        /// <summary>
        /// Initializes a new instance of the <see cref="LeapFeedError"/> class.
        /// </summary>
        /// <param name="reason">The textual error description.</param>
        public LeapFeedError(string reason) {
            this.Reason = reason;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="LeapFeedError"/> class.
        /// </summary>
        /// <param name="reason">The textual error description.</param>
        /// <param name="item">The item the error is associated with.</param>
        public LeapFeedError(string reason, SyndicationItem item) {
            this.Reason = reason;
            this.Item = item;
        }
    }
}
